#ifndef MONEYWINDOW_H
#define MONEYWINDOW_H

#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQuery>
#include "adddialog.h"


namespace Ui {
class MoneyWindow;
}

class MoneyWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MoneyWindow(QWidget *parent = 0);
    ~MoneyWindow();
    int countSql(QSqlQuery query);
    void initTotalTable();
    void initUserTable();

private slots:
    void on_actionExit_triggered();

    void on_AddButton_clicked();

    void on_SubtractButton_clicked();

    void on_NameComboBox_activated(const QString &arg1);

    void on_actionAdd_triggered();

    void onUpdateNameComBox();

    void on_userComboBox_activated(const QString &arg1);

    void on_tabWidget_tabBarClicked(int index);

private:
    Ui::MoneyWindow *ui;
    QSqlDatabase db;
    AddDialog *ad;
};

#endif // MONEYWINDOW_H
